From: Ian Campbell Date: Mon, 16 Aug 2010 14:31:05 +0000 (+0100) Subject: libxl: ensure result of libxl_poolid_to_name is always dynamically allocated X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11623 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=32234af4f20fc363d92fb7ddd773822e1d155844;p=xen.git libxl: ensure result of libxl_poolid_to_name is always dynamically allocated Signed-off-by: Ian Campbell Signed-off-by: Stefano Stabellini committer: Stefano Stabellini --- diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c index d8530073c9..bf318695f8 100644 --- a/tools/libxl/libxl_utils.c +++ b/tools/libxl/libxl_utils.c @@ -97,7 +97,7 @@ char *libxl_poolid_to_name(libxl_ctx *ctx, uint32_t poolid) char *s; if (poolid == 0) - return "Pool-0"; + return strdup("Pool-0"); snprintf(path, sizeof(path), "/local/pool/%d/name", poolid); s = xs_read(ctx->xsh, XBT_NULL, path, &len); return s;